<template>
  <div id="app">
    <!--为echarts准备一个具备大小的容器dom-->
    <div id="main" style="width: 800px; height: 300px"></div>
  </div>
</template>
<script>
import echarts from "echarts";
import {listFundsSelective} from "@/api/funds";
export default {
  name: "tongji",
  data() {
    return {
      queryParams: {
        id: 0,
        stageId: 0,
        roundId: 0,
        userId: 0,
      },
      charts: "",
      opinionData: [100],
      isWatch: false
    };
  },
  methods: {
    getFund(){
        var fundThree = this.$cookies.get('fundThree')
        // console.log(fundOne)
        if(fundThree != null){
          let a = [100]
          a = fundThree.split(',')
          this.opinionData = a
        }
        // if(a.length == this.queryParams.roundId){
        //   a.push(res.data.data.FundsSelective[2].fundPoint)
        //   this.$cookies.set('fundThree',a)
        //   a = fundThree.split(",")
        // }
        // console.log(res.data.data.FundsSelective)
    },
    drawLine(id) {
      this.charts = echarts.init(document.getElementById(id));
      this.charts.setOption({
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["12轮基金变化"],
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },

        //   toolbox: {
        //     feature: {
        //       saveAsImage: {},
        //     },
        //   },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: ["0", "1", "2", "3", "4","5","6","7","8","9","10","11","12"],
          axisTick:{
            show:false
          }
        },
        yAxis: {
          type: "value",
          axisTick:{
            show:false
          }
        },

        series: [
          {
            name: "12轮基金变化",
            type: "line",
            stack: "总量",
            data: this.opinionData,
          },
        ],
      });
    },
  },
  //调用
  mounted() {
    this.getFund()
    this.$nextTick(function () {
      this.drawLine("main");
    });
  },
};
</script>
<style scoped>
</style>
